wayland: Reference pixmap-based cursors' surface before handing the wl_buffer
authorCarlos Garnacho <carlosg@gnome.org>
Mon, 1 Sep 2014 16:44:48 +0000 (18:44 +0200)
committerCarlos Garnacho <carlosg@gnome.org>
Mon, 1 Sep 2014 18:46:29 +0000 (20:46 +0200)
commita0abdbbdd6a83db2a51fcd390472f177436b35ca
tree483148068dd7cbe225c269d60ffe63dd8221b02b
parentb2b948514e2bfd41f516401960ec23f74383a827
wayland: Reference pixmap-based cursors' surface before handing the wl_buffer

cairo_surface_destroy() is called after the buffer is released, for every
wl_buffer. Windows usually reference their cairo surface before rendering,
so that extra reference is consumed after the buffer is released, so do
the same with cursor surfaces and add an extra reference whenever a cursor
surface change is about to be scheduled.

Otherwise, the GdkWaylandCursor is left with an invalid cairo_surface_t,
which causes crashes the next time it is used.

https://bugzilla.gnome.org/show_bug.cgi?id=735830
gdk/wayland/gdkcursor-wayland.c